
<!-- saved from url=(0031)http://dkf.qq.com/demopage.html -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="UTF-8">
    <meta http-equiv="Content-Language" content="zh-cn">
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
    <title></title>
    <style>
        body {
            font-family: "Microsoft Yahei", Arial, sans-serif;
            font-size: 14px;
            background: #fff;
            overflow-x:hidden;
        }
        .title{
            font-size: 15px;
            margin-bottom:5px;
        }
        .content{
            margin-bottom:10px;
        }
        .textarea{
            background-color: #FFFCEC;
        }
        .module{
            border: 1px solid #DDDDDD; padding:5px; margin-bottom:10px;
        }
        .button {
            display: inline-block;
            position: relative;
            margin: 0px;
            padding: 0 20px;
            text-align: center;
            text-decoration: none;
            font: bold 12px/25px Arial, sans-serif;

            text-shadow: 1px 1px 1px rgba(255,255,255, .22);

            -webkit-border-radius: 30px;
            -moz-border-radius: 30px;
            border-radius: 30px;

            -webkit-box-shadow: 1px 1px 1px rgba(0,0,0, .29), inset 1px 1px 1px rgba(255,255,255, .44);
            -moz-box-shadow: 1px 1px 1px rgba(0,0,0, .29), inset 1px 1px 1px rgba(255,255,255, .44);
            box-shadow: 1px 1px 1px rgba(0,0,0, .29), inset 1px 1px 1px rgba(255,255,255, .44);

            -webkit-transition: all 0.15s ease;
            -moz-transition: all 0.15s ease;
            -o-transition: all 0.15s ease;
            -ms-transition: all 0.15s ease;
            transition: all 0.15s ease;
        }
        .green {
            color: #3e5706;
            background: #a5cd4e;
        }
    </style></head>

<body style="">
<div>
    <div class="module">
        <div class="title">
            <span>用户信息</span>
        </div>
        <div>
            <span style="">客服账号：</span><span type="text" id="workeraccount">`null'&nbsp;doesn't&nbsp;seem&nbsp;as&nbsp;a&nbsp;valid&nbsp;ticket</span>
        </div>
        <div>
            <span style="">当前访客：</span><span type="text" id="toUin"></span>
        </div>
    </div>
    <div class="module">
        <div class="title">
            <span>订单查询</span>
        </div>
        <form action="{:U('index')}" method="post" style="display:inline ">
            <label for="orderid">订单号</label><input type="text" id="orderid" name="orderid" value="{$orderid}">
            <input type="submit" value="提交">
        </form>
        <form action="{:U('index')}" method="post" style="display: inline-block;">
            <input type="hidden" name="openid" id="openid" />
            <input type="submit" value="当前用户订单" />
        </form>
        <div>
            <textarea type="text"  style="display: none;" name="messageData" id="messageData" class="textarea" style="height:150; width:100%; overflow-y: auto;"></textarea>
        </div>
        <div>
            <empty name="_list">没有数据
                <else/>
                <table style="font-size:11px;">
                    <tr>
                        <th>订单号</th>
                        <th>类型&金额</th>
                        <th>下单时间</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    <volist name = "_list" id="vo">
                        <tr>
                            <td>{$vo.orderid}</td>
                            <td>{$vo.type_text}({$vo.total})</td>
                            <td>{$vo.createdAt|iso_to_date}</td>
                            <td>{$vo.status_text}</td>
                            <td><a href="{:U('detail')}">明细</a></td>
                        </tr>
                    </volist>
                </table>
            </empty>
        </div>
    </div>

    <div class="module">
        <div class="title">
            <span>操作流水</span>
        </div>
        <div class="content">
            <textarea id="area" class="textarea" style="height:260px;width:100%;overflow-y:auto"></textarea>
        </div>
    </div>
</div>
<script type="text/javascript" src="http://o2o.gtimg.com/module/jquery.js" ></script>
<script type="text/javascript" src="http://js.aq.qq.com/js/aq_common.js" ></script>
<script>
    var ticket = getUrlParam('ticket');
    var workerAccouont = '';
    setmsg(1);
    $.getScript('http://crm1.dkf.qq.com/php/index.php/thirdapp/appdemo/get_workeraccount_by_sessionkey?callback=wokeraccountCallback&ticket='+ticket);
    $('.pic').click(function(){
        var imgurl = $(this).attr('data-pic');
        var pid = $(this).attr('data-pid');
        var pname = $(this).attr('data-name');
        var intro = $(this).attr('data-intro');
        var url = "http://mdev.guoran100.com/detail/"+pid+"";
        var promsg =['{"head":{"random":"{#random#}"}, "body":[{"type":7, "content":[{"title":"'+pname+'", "digest":"'+intro+'", "cover":"'+imgurl+'", "url":"'+url+'"}]}]}'];
        document.getElementById('messageData').value = promsg[0].replace("{#random#}",  Math.ceil(Math.random()*10000000));
        var strReturn = window.external.PutMsg('{"msg":'+document.getElementById('messageData').value+'}');
        document.getElementById('area').value += 'put msg return:' + strReturn +'\n';
    })
    function wokeraccountCallback(data){
        document.getElementById('area').value += '您现在登录的帐号是：' +  $xss(data.workeraccount,"html") + '\n';
        document.getElementById('workeraccount').innerHTML =  $xss(data.workeraccount,"html");
    }
    function MCS_ClientNotify(EventData) {
        EventData = strToJson(EventData);
        switch(EventData['event']){
            case 'OnUserChange':{
                OnUserChange(EventData);
                break;
            }
            case 'OnMapMsgClick':{
                OnMapMsgClick(EventData);
                break;
            }
        }
    }
    function OnUserChange(data){
        document.getElementById('toUin').innerHTML = data['userid'];
        $('#openid').val(data['userid']);
        var str = document.getElementById('area').value;

        str += "切换到用户:" + data['userid'] + ", channeltype:" + data['channeltype'] + "\n";

        try{
            if(data.hasOwnProperty('visitorid')){

            }
            document.getElementById('area').value += 'hasOwnProperty no problem';
        }catch(e){
            document.getElementById('area').value += e.message;
        }

        document.getElementById('area').value = str;
    }
    function OnMapMsgClick (data) {
        $id('area').value += "latitude :" + data['latitude'] + ",longitude:" + data['longitude'] + ",location :" + data['location'] + ",scale :" + data['scale'];
    }
    function putmsg(){
        var strReturn = window.external.PutMsg('{"msg":'+'{"head":{"random":"{#random#}"}, "body":[{"type":7, "content":[{"title":"常见问题", "digest":"查看全文", "cover":"http://p.qpic.cn/ecc_merchant/0/P_idc2844234_1399602518774/0", "url":"http://weigou.qq.com/wkd/messages/show/cid-cc_idc_208646"}]}]}'+'}');
        document.getElementById('area').value += 'put msg return:' + strReturn +'\n';
    }
    function setmsg(d){
        var msg = [
            '{"head":{"random":"{#random#}"}, "body":[{"type":7, "content":[{"title":"常见问题", "digest":"查看全文", "cover":"http://p.qpic.cn/ecc_merchant/0/P_idc2844234_1399602518774/0", "url":"http://weigou.qq.com/wkd/messages/show/cid-cc_idc_208646"}]}]}',
            '{"head":{"random":"{#random#}"}, "body":[{"type":1, "content":{"picUrl":"http://p.qpic.cn/ecc_merchant/0/P_idc2844234_1399602518774/0"}}]}',
            '{"head":{"random":"{#random#}"}, "body":[{"type":0, "content":{"text":"您好，请问有什么可以帮到您的呢"}}]}'
        ];

        document.getElementById('messageData').value = msg[d-1].replace("{#random#}",  Math.ceil(Math.random()*10000000));
    }
    function strToJson(str){
        var json = (new Function("return " + str))();
        return json;
    }
    function getUrlParam(name) {
        var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
        var r = window.location.search.substr(1).match(reg);  //匹配目标参数
        if (r!=null) return unescape(r[2]); return null; //返回参数值
    }
    function notice(){
        document.getElementById('area').value += '5秒钟后开始执行notice,请先切换到其他TAB\n'
        document.getElementById('noticecon').innerHTML="(5秒钟后开始执行notice,请先切换到其他TAB)";
        setTimeout('window.external.Notice("");',5000);
    }
    function $xss(str,type){
        //空过滤
        if(!str){
            return str===0 ? "0" : "";
        }

        switch(type){
            case "none": //过度方案
                return str+"";
                break;
            case "html": //过滤html字符串中的XSS
                return str.replace(/[&'"<>\/\\\-\x00-\x09\x0b-\x0c\x1f\x80-\xff]/g, function(r){
                    return "&#" + r.charCodeAt(0) + ";"
                }).replace(/ /g, " ").replace(/\r\n/g, "<br />").replace(/\n/g,"<br />").replace(/\r/g,"<br />");
                break;
            case "htmlEp": //过滤DOM节点属性中的XSS
                return str.replace(/[&'"<>\/\\\-\x00-\x1f\x80-\xff]/g, function(r){
                    return "&#" + r.charCodeAt(0) + ";"
                });
                break;
            case "url": //过滤url
                return escape(str).replace(/\+/g, "%2B");
                break;
            case "miniUrl":
                return str.replace(/%/g, "%25");
                break;
            case "script":
                return str.replace(/[\\"']/g, function(r){
                    return "\\" + r;
                }).replace(/%/g, "\\x25").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\x01/g, "\\x01");
                break;
            case "reg":
//                return str.replace(/[\\\^\$\*\+\?\{\}\.\(\)\[\]]/g, function(a){
//                    return "\\" + a;
//                });
                break;
            default:
                return escape(str).replace(/[&'"<>\/\\\-\x00-\x09\x0b-\x0c\x1f\x80-\xff]/g, function(r){
                    return "&#" + r.charCodeAt(0) + ";"
                }).replace(/ /g, " ").replace(/\r\n/g, "<br />").replace(/\n/g,"<br />").replace(/\r/g,"<br />");
                break;
        }
    }
</script>
<!--[if !IE]>|xGv00|2f14d77d7739039937aab423ff99ce10<![endif]--></body></html>